<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page language="java" import="java.util.List"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>    
<% List<?> result = (List<?>)request.getAttribute("result"); %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<% String myContext = request.getContextPath(); %>
<style type="text/css">
.bookDetail {
	float: left;
	width: 600px;
	font-size: small;
	font-family: 맑은 고딕;
	margin: 20px 20px 40px 0px;
}
</style>
<script type="text/javascript" src="./jquery/jquery.js"></script>

<script type="text/javascript">
function chan(vala){
	var value =  vala.options.selectedIndex;
	var txt = vala.options[value].text;
	document.bookDetail.mailchoice.value = txt;
}
</script>

<div id="BCDetail">
	<div align="center">
		<form class="bookDetail" name="bookDetail" action="AdminUpdate.admin" method="POST">
			<table>
			<c:forEach var="item" items="${result}">
				<tr>
					<th>회원 번호</th>
					<td>
						<label>${item.mnum}</label>
					</td>
				</tr>
				<tr>
					<th>아이디</th>
					<td>
						<input type="hidden" id="mnum" name="mnum" value="${item.mnum }">
						<label>${item.mid}</label>
					</td>
				</tr>
				<tr>
					<th>이름</th>
					<td><input type="text" id="mname" name="mname" value="${item.mname }"></td>
				</tr>
				<tr>
					<th>권한 그룹</th>
					<td>
						<select id="granted" name="granted">
							<option value="">현재권한 ${item.granted}
							<option value="A">관리자 A
							<option value="U">사용자 U
						</select>
					</td>
				</tr>
				<tr>
					<th>생년월일</th>
					<td>
						<input type="text" id="mssn1" name="mssn1" value="${item.mssn1 }"> -
						<input type="text" id="mssn2" name="mssn2" value="${item.mssn2 }">
					</td>
				</tr>
				<tr>
					<th>전화번호</th>
					<td>
						<input type="text" id="mphone1" name="mphone1" value="${item.mphone1 }"> - 
						<input type="text" id="mphone2" name="mphone2" value="${item.mphone2 }"> - 
						<input type="text" id="mphone3" name="mphone3" value="${item.mphone3 }">
					</td>
				</tr>
				<tr>
					<th>이메일</th>
					<td>
						<input type="text" id="email" name="email" value="${item.email }">@
						<input type="text" id="mailchoice" name="mailchoice" value="${item.mailchoice }">
						<select id="choice" name="choice" onchange="chan(this);">
								<option value="" selected="selected">직접 입력</option>
								<option value="naver.com">naver.com</option>
								<option value="hanmail.net">hanmail.net</option>
								<option value="daum.net">daum.net</option>
								<option value="gmail.com">gmail.com</option>
						</select>
					</td>
				</tr>
				<tr>
					<th>우편번호</th>
					<td><input type="text" id="mzipcode" name="mzipcode" value="${item.mzipcode }"></td>
				</tr>
				<tr>
					<th>주소</th>
					<td><input type="text" id="maddress" name="maddress" value="${item.maddress }"></td>
				</tr>
				<tr>
					<th>가입일자</th>
					<td><input type="text" id="mdate" name="mdate" value="${item.mdate }"></td>
				</tr>
			</c:forEach>
				<tr>
					<td colspan="4" align="right">
						<input type="button" class="button2" value="수정" onclick="ajaxReturn('AdminUpdate.admin','수정 처리되었습니다.');">
						<input type="button" class="button2" value="삭제" onclick="ajaxReturn('AdminDelete.admin','삭제 처리되었습니다.');">
						<a href="<%=myContext%>/adminPage.admin"><input type="button" class="button2" value="돌아가기"></a>
					</td>
				</tr>
			</table>
		</form>	
<!-- 				<a href="#" onclick="ajaxReturn('AdminUpdate.admin','수정 처리되었습니다.');"><input type="button" class="button2" value="수정"></a> -->
<!-- 				<a href="#" onclick="ajaxReturn('AdminDelete.admin','삭제 처리되었습니다.');"><input type="button" class="button2" value="삭제"></a> -->
<%-- 				<a href="<%=myContext%>/adminPage.admin"><input type="button" class="button2" value="돌아가기"></a> --%>
	</div>
</div>
